// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   GTSHullImpl.java

package com.sunwayhorizo.health.hl7.datatypes.common;

import com.sunwayhorizo.health.hl7.common.Hl7Exception;
import com.sunwayhorizo.health.hl7.common.VersionInfo;
import com.sunwayhorizo.health.hl7.datatypes.ANY;
import com.sunwayhorizo.health.hl7.datatypes.BL;
import com.sunwayhorizo.health.hl7.datatypes.GTS;
import com.sunwayhorizo.health.hl7.datatypes.INT;
import com.sunwayhorizo.health.hl7.datatypes.IVL_TS;
import com.sunwayhorizo.health.hl7.datatypes.SET_TS;
import com.sunwayhorizo.health.hl7.datatypes.ST;
import com.sunwayhorizo.health.hl7.datatypes.TS;
import com.sunwayhorizo.health.hl7.datatypes.TYPE;
import com.sunwayhorizo.health.hl7.datatypes.common.gtsparser.TimeParser;

import java.io.StringReader;

import java.util.Set;


// Referenced classes of package oracle.apps.ctb.hl7.types.common:
//            GTSBase, ANYImpl, GTSNullImpl, STImpl, 
//            TYPEImpl

public class GTSHullImpl extends GTSBase
    implements GTS
{

    public static final String RCS_ID = "$Header: GTSHullImpl.java 115.20.2050.2 2006/02/22 05:18:49 mmoores noship $";
    public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header: GTSHullImpl.java 115.20.2050.2 2006/02/22 05:18:49 mmoores noship $", "oracle.apps.ctb.hl7.types.common");
    protected IVL_TS m_hull;

    public static GTS valueOf(String s)
        throws Hl7Exception
    {
        StringReader stringreader = new StringReader(s);
        TimeParser timeparser = new TimeParser(stringreader);
        try
        {
            GTS gts = timeparser.gts();
            GTSBase.checkParserState(timeparser);
            ((GTSBase)gts)._literal = STImpl.valueOf(s);
            ((GTSBase)gts)._dataType = com.sunwayhorizo.health.hl7.datatypes.common.TYPEImpl.GTS;
            return gts;
        }
        catch(Throwable throwable)
        {
            throw ANYImpl.newParseException("GTS", s, throwable);
        }
    }

    public static GTS valueOf(IVL_TS ivl_ts)
    {
        if(ivl_ts.isNull().isTrue())
            return GTSNullImpl.nullGTS(ivl_ts.nullFlavor());
        else
            return new GTSHullImpl(ivl_ts);
    }

    protected GTSHullImpl(IVL_TS ivl_ts)
    {
        if(ivl_ts == null)
        {
            throw ANYImpl.newNullException("GTS", "constructor", "hull");
        } else
        {
            m_hull = ivl_ts;
            return;
        }
    }

    public ST literal()
    {
        return m_hull.literal();
    }

    public BL equal(ANY any)
    {
        throw ANYImpl.newUnsupportedException("GTS", "equal");
    }

    public TYPE dataType()
    {
        return com.sunwayhorizo.health.hl7.datatypes.common.TYPEImpl.GTS;
    }

    public BL isEmpty()
    {
        throw ANYImpl.newUnsupportedException("GTS", "type");
    }

    public BL notEmpty()
    {
        return isEmpty().not();
    }

    public BL contains(TS ts)
    {
        return m_hull.contains(ts);
    }

    public BL contains(SET_TS set_ts)
    {
        return m_hull.contains(set_ts);
    }

    public INT cardinality()
    {
        throw ANYImpl.newUnsupportedException("GTS", "cardinality");
    }

    public SET_TS union(SET_TS set_ts)
    {
        if(set_ts instanceof GTS)
            return union(((SET_TS) ((GTS)set_ts)));
        else
            throw ANYImpl.newUnsupportedException("GTS", "union");
    }

    public SET_TS union(TS ts)
    {
        throw ANYImpl.newUnsupportedException("GTS", "union");
    }

    public SET_TS intersection(SET_TS set_ts)
    {
        if(set_ts instanceof GTS)
            return intersection(((SET_TS) ((GTS)set_ts)));
        else
            throw ANYImpl.newUnsupportedException("GTS", "intersection");
    }

    public SET_TS except(SET_TS set_ts)
    {
        if(set_ts instanceof GTS)
            return except(((SET_TS) ((GTS)set_ts)));
        else
            throw ANYImpl.newUnsupportedException("GTS", "except");
    }

    public SET_TS except(TS ts)
    {
        throw ANYImpl.newUnsupportedException("GTS", "except");
    }

    public Set toSet()
    {
        throw ANYImpl.newUnsupportedException("GTS", "toSet");
    }

    public IVL_TS hull()
    {
        return m_hull;
    }

}
